NevronOpenVision
Nevron.Nov.Dom Namespace / NDocumentFormatRegistry<TDocumentFormat> Class / GetFromExtensionAndHeader Method / GetFromExtensionAndHeader(String,Byte[],Boolean,Int32) Method
File extension without the dot, for example "txt", "docx" and so on.
File header. Can be null.
Indicates whether the file is for reading or for writing.
The match score of the returned document format. Can be:

2 - the returned document format matches both the given file extension and header

1 - the returned document format matches either the given file extension or header

0 - the returned document format is the default document format, because no format in this registry matches the given file extension or header

GetFromExtensionAndHeader(String,Byte[],Boolean,Int32) Method
Gets a document format from the specified extension and header.
Syntax
public TDocumentFormat GetFromExtensionAndHeader( 
   System.string fileExtension,
   System.byte[] header,
   System.bool forReading,
   out System.int matchScore
)

Parameters

fileExtension
File extension without the dot, for example "txt", "docx" and so on.
header
File header. Can be null.
forReading
Indicates whether the file is for reading or for writing.
matchScore
The match score of the returned document format. Can be:

2 - the returned document format matches both the given file extension and header

1 - the returned document format matches either the given file extension or header

0 - the returned document format is the default document format, because no format in this registry matches the given file extension or header

Requirements

Target Platforms: Windows 11, Windows 10, Windows 7, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later)

See Also